<template>
    <el-dialog :title="title" width="700px" :visible.sync="openFormData.formVisible">
      <el-form :inline="true"  :model="openFormData.formData">

            <el-form-item label="显示名" :label-width="openFormData.formLabelWidth">
                <el-input 
                    v-model="openFormData.formData.showName" 
                    autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="表名" :label-width="openFormData.formLabelWidth">
                <el-input 
                    v-model="openFormData.formData.tableName" 
                    autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="包路径" :label-width="openFormData.formLabelWidth">
                <el-input 
                    v-model="openFormData.formData.packagePath" 
                    autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="模块名称" :label-width="openFormData.formLabelWidth">
                <el-input 
                    v-model="openFormData.formData.moduleName" 
                    autocomplete="off"></el-input>
            </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
            <el-button @click="openFormData.formVisible = false">取 消</el-button>
            <el-button type="primary" @click="onSubmit">确 定</el-button>
      </div>
    </el-dialog>
</template>
<script>


    export default {
        data() {
            return {
                openFormData: {
                    formVisible:false,
                    formData:{},
                    formFields:[],
                    formLabelWidth:'120px',
                },
                title:''
            }
        },
        methods: {
            show() {
                var _this = this;
                _this.openFormData.formVisible = true;
            },
            onSubmit() {
                var _this = this;
                _this.myUtils.appRequest({
                    url: '/java/sys/model/subImport',
                    method:'post',
                    data:_this.openFormData.formData,
                    callback:function(data) {
                        _this.openFormData.formVisible = false;
                        _this.$message({
                            showClose: true,
                            message: data.message,
                            type: 'success'
                        });
                         _this.$emit('loadData');
                    },
                    catch: function(res) {
                        console.log(res);
                    }
                }, _this);

            },
        },
        props:[],
        components: {  }
    }
</script>
<style>
.el-form--inline .form-item {
    width:50%;margin-right:0;
}
.el-form--inline .hide{
    display:none;
}
.el-input--suffix .el-input__inner{
    padding-right:15px;
}
.el-date-editor.el-input--suffix .el-input__inner{
    padding-right:0px;
}
.el-date-editor.el-input, .el-date-editor.el-input__inner{
    width:auto;
}
</style>